<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('修改商品')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-edit" th:object="${commodity}">
			<input id="id" name="id" type="hidden" th:field="*{id}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">商品名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="commodityName" id="commodityName" th:field="*{commodityName}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">商品库存：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="commodityNum" id="commodityNum" th:field="*{commodityNum}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">商品单价金额：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="commodityAmount" id="commodityAmount" th:field="*{commodityAmount}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">商品状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
						<input type="radio" th:id="${dict.dictCode}" name="commodityStatus" th:value="${dict.dictValue}" th:field="*{commodityStatus}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "commodity";

		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-post-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
